home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: Explain this> %s \"%[^\"]\"
- Date: 29 Feb 96 12:30:03 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.825597003@rscernix>
- References: <4h2t6u$v56@useneta1.news.prodigy.com>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- DZYS46D@prodigy.com (David Cunningham) writes:
-
- >I have a file that contains text like this:
- >
- >012345678 "Joe Smith"
- >
- >I also have an example of sscanf to pick out these fields. Can someone
- >translate what \"%[^\"]\"%d" means. I need to have a good understanding
- >of this for a homework assignment. It looks like this:
- >
- >sscanf(buff,"%s \ "%[^\"]\" %d",student_list->ss_num,student_list->name);
-
- This format string matches neither the input line nor the sscanf
- argument list. Make it: "%s \"%[^\"]\"" if student_list->ss_num is
- a character array, "%d \"%[^\"]\"" if it is an int, and so on.
-
- >Please explain what these hieroglyphics mean, character by character.
-
- Please open your C book and read the description of the scanf library
- function. This newsgroup is not meant as a replacement for your book.
- If, after reading it, you still have problems with this format string,
- feel free to ask specific specific questions about the parts you don't
- understand.
-
- We are here to help you, not to spoon-feed you.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-